package com.calt.plm.basic.core.action;

import com.calt.plm.basic.core.annoation.BusinessAction;
import com.calt.plm.basic.core.context.EntityContext;
import com.calt.plm.basic.core.entity.AbstractActionEntity;
import com.calt.plm.basic.core.featuretest.entity.PartEntity;
import com.calt.plm.basic.core.service.EntityQueryService;
import org.springframework.beans.factory.annotation.Qualifier;

import java.util.List;

@BusinessAction(name = "container")
public interface ContainerI extends Action
{
    String CONTAINER_ID = "container_id";
    String TEAM_ID = "team_id";

    default void containerAdd(EntityContext context)
    {
//        // TODO
//        context.getEntity().forEach();
       /* List<AbstractActionEntity> abstractActionEntityList = context.getEntity(this.getClass());
        EntityQueryService queryService = context.getBean(EntityQueryService.class);
        List historyList;

        abstractActionEntityList.forEach(entity -> {
            AbstractActionEntity history = queryService.get(AbstractActionEntity.class, entity.getId());
            AbstractActionEntity newObj = new AbstractActionEntity(null);
            // copy
            history.putActionProp(TEAM_ID, "0");
            newObj.putActionProp(CONTAINER_ID, "1.1");
        });
        this.update(context, historyList);
        this.save();*/
    }
}
